package Reflect.test1;

import java.lang.reflect.Constructor;

public class Test {
    public static void main(String[] args) throws Exception {


        Class cls = Class.forName("Reflect.test1.StudentTest");

        Constructor constructor = cls.getConstructor(String.class,int.class,char.class);
        Object obj1 = constructor.newInstance("赵家康",3,'男');
        System.out.println("有参构造器: "+obj1);

        Object obj2 = cls.newInstance();
        System.out.println("无参构造器: "+obj2);
    }
}
